<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="com.cap.bts.framework.usermgnt.constant.EmployeeStatus"%>    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> Data conversion接口调用日志</title>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<core:set var ="webcontext" scope="request" value="${pageContext.request.contextPath}"/>
<core:set var ="imagepath" scope="request" value="${webcontext}/images"/>
<core:set var ="csspath" scope="request" value="${webcontext}/css"/>
<core:set var ="jspath" scope="request" value="${webcontext}/javascript"/>
<core:set var ="jsppath" scope="request" value="${webcontext}/jsp"/>
<core:set var ="htmlpath" scope="request" value="${webcontext}/html"/>
<core:set var ="bootstrapPath" scope="request" value="${webcontext}/bootstrap"/>
<core:set var ="layerPath" scope="request" value="${webcontext}/layer"/>
<!-- TODO the gdms url should replace by the token -->
<core:set var ="gdmsurl" scope="request" value="@token-gdms.server.servlet.context.url.integration@"/>
<script type="text/javascript">
	var contextPath = "${webcontext}";
</script>
<%@page import="com.cap.bts.framework.common.util.Pager"%>
<%@page import="com.cap.bts.framework.common.constant.CommonConstants"%>
<%@page import="com.cap.bts.framework.common.util.CodeTextUtils"%>
<%@page import="com.cap.bts.framework.common.util.CookieUtils"%>
<%@page import="com.cap.bts.framework.auth.constant.AuthConstant"%>

<script type="text/javascript" src="${jspath }/jquery/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${jspath }/../layer/layer.js"></script>
<link rel="stylesheet" type="text/css"	href="${bootstrapPath}/css/bootstrap.css" />
<script type="text/javascript" src="${jspath}/template.js"></script>
<style type="text/css">
* {
	margin: 0px;
	padding: 0px;
	font-size: 12px;
	font-family: sans-serif;
}
th{white-space:nowrap;color: #FFF; background:#00af4e;}
th,td{border: 1px solid #ddd; }
.encrypt{max-width:300px;word-wrap: break-word; word-break: normal; }
.normalXml{max-width:250px;word-wrap: break-word; word-break: normal; }
.search{text-align:center;padding:15px;}
.michelin-btn{background-color:#00af4e; color:#FFF; border:none;padding: 5px 15px;margin-left:20px;}
input{width:50px;font-weight:bold;text-align:center;}
</style>

<script type="text/javascript">
$(function(){
	loadPage();
});

	function loadPage() {
		var layerIndex = layer.load(1, {
		    shade: [0.4,'#000'] 
		});

		$.ajax({
			type : 'POST',
			dataType:'json',
			url : '${webcontext}/logDataConversion/data',
			async : true,
			data : "currentPage=" + $("#currentPage").val()
					+ "&pageSize=" + $("#pageSize").val(),
			dataType : 'json',
			success : function(data) {
				layer.close(layerIndex);
				var html = template('tr-template', {"list": data} );
				$('#dataContainer').html(html);
				
			},
			error: function(){
				layer.close(layerIndex);
				layer.alert("数据加载失败！", {icon : 2});
			}
		});
	}
</script> 
</head>
<body>

<div class="search"> 每页显示<input type="text" value="10" id="pageSize"> 条，显示第<input type="text" value="1" id="currentPage"> 页 <button class="michelin-btn" onclick="loadPage();">查询</button></div>
	<table class="table">
		<tr>
			<th></th>
			<th>调用时间</th>
			<th>当前状态</th>
			<th>传入参数</th>
			<th>发送数据</th>
			<th>返回数据</th>
			<th>说明</th>
		</tr>
		<tbody id="dataContainer">
		</tbody>
		

	</table>
<script id="tr-template" type="text/html">
{{each list as v i}}
<tr>
        <td></td>
		<td>{{v.callTime}}</td>
		<td>
			{{if v.status == 1}}
				待处理
			{{else if v.status == 2}}
				处理中
			{{else if v.status == 3}}
				成功
			{{else if v.status == 4}}
				失败
			{{else if v.status == 5}}
				相同批次号不重复处理
			{{/if}}
		</td>
		<td><div class="normalXml">{{v.paramText}}</div></td>
		<td><div class="normalXml">{{v.sendText}}</div></td>
		<td><div class="normalXml">{{v.returnText}}</div></td>
		<td><div class="encrypt">{{v.descp}}</div></td>
</tr>
{{/each}}
</script>
</body>
</html>